/**
 * Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 * Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

@import '../../css/variable.css';

.bk-number {
    display: inline-block;
    position: relative;
    min-width: 80px;
    border: 1px solid $fnMinorColor;
    border-radius: 2px;
    vertical-align: middle;
    padding-right: 0;

    ::placeholder {
        color: $fnMinorColor;
    }

    &.is-error {
        border-color: red;
    }

    &.focus {
        border-color: $primaryColor;
    }

    &.disabled {
        background: #fafafa;

        .bk-number-input {
            color: #ccc;
        }

        .bk-number-icon-top,
        .bk-number-icon-lower {
            cursor: not-allowed;
        }

        .bk-number-content {
            background: #fafafa;
        }
    }

    .bk-number-content {
        color: #666;
        background-color: #fff;
        width: 100%;
        box-sizing: border-box;
        padding: 0 10px;
        font-size: 14px;
        text-align: left;
        vertical-align: middle;

        &.bk-number-larger {
            height: 34px;
            line-height: 34px;

            .bk-number-icon-content {
                margin-top: 3px !important;
            }
        }

        &.bk-number-small {
            height: 32px;
            line-height: 32px;

            .bk-number-icon-content {
                margin-top: 1px !important;
            }
        }

        .bk-number-input {
            width: 100%;
            -moz-appearance: textfield;
            border: none;
            outline: none;
            background: none;
            height: 100%;
            vertical-align: middle;
            margin-top: -2px;
        }

        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none !important;
            margin: 0;
        }

        .bk-number-icon-content {
            line-height: 1;
            cursor: pointer;
            position: absolute;
            right: 10px;
            top: 1px;

            i {
                font-size: 12px;
                font-weight: bold;
                color: #c3cdd7;
            }

            .btn-disabled {
                cursor: not-allowed;
            }
        }
    }
}
